<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <style>
    @font-face {
      font-family: 'Skycoin';
      src: url('../fonts/skycoin/Skycoin-Regular.woff2') format('woff2');
    }

    .error-msg-container {
      font-family: Skycoin;
      color: white;
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      overflow: hidden;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      text-align: center;
      background: #0072ff; /* For browsers that do not support gradients */
      background: -webkit-linear-gradient(left top, #0072ff, #00C3ff); /* For Safari 5.1 to 6.0 */
      background: -o-linear-gradient(bottom right, #0072ff, #00C3ff); /* For Opera 11.1 to 12.0 */
      background: -moz-linear-gradient(bottom right, #0072ff, #00C3ff); /* For Firefox 3.6 to 15 */
      background: linear-gradient(to bottom right, #0072ff, #00C3ff); /* Standard syntax */
    }

    .internal-container {
      width: 100%;
      max-width: 650px;
      display: inline-block;
      margin: 0 80px;
    }

    .image {
      width: 80px;
      height: 80px;
    }

    #title {
      font-size: 24px;
      margin-top: 15px;
    }

    #text {
      font-size: 13px;
      line-height: 1.8;
      margin-top: 15px;
    }

    a {
      color: white;
    }
  </style>
</head>
<body>
  <div class="error-msg-container">
    <div class="internal-container">
      <img class="image" src="big-error-icon.png">
      <div id="title"></div>
      <div id="text"></div>
    </div>
  </div>
</body>
</html>

<script>
  var lang = navigator.language || navigator.userLanguage;
  var telegramLink1 = '<a href="https://web.telegram.org/#/im?p=@skycoinsupport" target="_blank" rel="noreferrer nofollow">';
  var telegramLink2 = '</a>';

  // Send ?2 at the end of the URL to show error number 2.
  if (window.location.toString().indexOf('?2') !== -1) {
    // It is possible to add more languages in the future.
    if (lang.substr(0, 2).toLowerCase == 'en' || true) {
      document.getElementById('title').innerHTML = 'Error #2';
      document.getElementById('text').innerHTML = 'Cannot reach backend. Please restart the app and/or seek help on our ' + telegramLink1 + 'Telegram.' + telegramLink2;
    }
  } else {
    if (lang.substr(0, 2).toLowerCase == 'en' || true) {
      document.getElementById('title').innerHTML = 'Error #1';
      document.getElementById('text').innerHTML = 'It is not possible to connect to the backend. Please restart the app and/or seek help on our ' + telegramLink1 + 'Telegram.' + telegramLink2;
    }
  }
</script>
